package ca.uwo.android.campusmap;

public class BuildingData {
	//name of the tags
	//static final String BUILDING = "building";
	static final String BUILDING_NAME = "name";
	static final String LONGITUDE = "longitude";
	static final String LATITUDE = "latitude";
	static final String ADDRESS = "address";

	//private String building;
	private String name;
	private String longitude;
	private String latitude;
	private String address;
	
	//mutator methods
	public void setBuilding(String n) {
		name = n;
	}	
	
	public void setLongitude(String l) {
		longitude = l;
	}
	
	public void setLatitude(String l) {
		latitude = l;
	}

	public void setAddress(String a) {
		address = a;
	}

	//accessor methods
	public String getBuilding() {
		return name;
	}
	
	public String getLongitude() {
		return longitude;
	}

	public String getLatitude() {
		return latitude;
	}
	
	public String getAddress() {
		return address;
	}
	
	//toXML
	// <building>
	// 		<name>BUILDING_NAME</name>
	// 		<longitude>LONGITUDE</longitude>
	// 		<latitude>LATITUDE</latitude>
	// 		<address>ADDRESS</address>
	// </building>
	public String toXML() {
		StringBuffer sb = new StringBuffer();
		sb.append("<building>\n");
		sb.append("\t<longitude>" + longitude + "</longitude>\n");
		sb.append("\t<latitude>" + latitude + "</latitude>\n");
		sb.append("\t<address>" + address + "</address>\n");
		sb.append("</building>\n");
		
		return sb.toString();
	}
	
}
